home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / BoundedFifo.h < prev    next >
C/C++ Source or Header  |  1990-07-09  |  1KB  |  43 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. // 
  3. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  4. // Copyright (C) 1989 University of Colorado, Boulder, Colorado
  5. // Copyright (C) 1990 University of Colorado, Boulder, Colorado
  6. //
  7. // written by Dirk Grunwald (grunwald@foobar.colorado.edu)
  8. //
  9. #ifndef BoundedFifo_h
  10. #define BoundedFifo_h
  11. #pragma once
  12.  
  13. #include <LowerBoundedFifo.h>
  14.  
  15. //
  16. // A BoundedFifo is a LowerBoundedFifo that also has an upper bound.
  17. // The members are implemented over the LowerBoundedFifo members to
  18. // reduce the number of calls.
  19. //
  20. class BoundedFifo : public LowerBoundedFifo {
  21.  
  22. protected:
  23.     int pMaxLength;
  24.     FifoScheduler upperBoundLockFifo;
  25.     Semaphore upperBoundLock;
  26.  
  27. public:
  28.  
  29.     BoundedFifo(int xmaxLength = 1, int defaultLength = 0);
  30.  
  31.     virtual void add(AwesimeFifoItem *t);
  32.     virtual bool remove(AwesimeFifoItem *item);
  33.     virtual bool removeNoBlock(AwesimeFifoItem *item);
  34.  
  35.     virtual bool removeIfFound(AwesimeFifoItem *item);
  36.  
  37.     virtual bool doDelete(AwesimeFifoIndex& index);
  38.  
  39.     virtual unsigned size();
  40. };
  41.              
  42. #endif BoundedFifo_h
  43.